% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/district-coding.R
\name{to_cd}
\alias{to_cd}
\title{Concatenate to Congressional District code}
\usage{
to_cd(state, num)
}
\arguments{
\item{state}{A vector of state names, preferably abbreviations.
If it is numeric, the function will assume they are FIPS codes
and translate them accordingly. If they have full names like "California"
instead of "CA", it will trnslate that too.}

\item{num}{A vector of district codes}
}
\description{
Concatenate to Congressional District code
}
\examples{
library(dplyr)

 to_cd(c("AL", "AK"), c("5", "AL"))
 to_cd(c(1, 2), c("5", "AL"))
 to_cd(c("Alabama", "Alaska"), c("5", "AL"))

 transmute(cc18_samp,
           inputstate,
           cdid115,
           cd = to_cd(inputstate, cdid115))

}
